package eerbaar.v2.app.core;

import java.awt.Component;
import java.awt.Dimension;

import javax.swing.JPanel;

public class GamePanel {

    private final JPanel panel = new JPanel();
    private final IGamePanelListener listener;

    public GamePanel(IGamePanelListener listener) {
        this.panel.setLayout(null);
        this.listener = listener;
    }

    public void add(Component child) {
        this.panel.add(child);
    }

    protected IGamePanelListener getListener() {
        return this.listener;
    }

    public JPanel getPanel() {
        return this.panel;
    }

    public Dimension getPreferredSize() {
        return this.panel.getPreferredSize();
    }

    public void removeAll() {
        this.panel.removeAll();
    }

    public void setBounds(int x, int y, int width, int height) {
        this.panel.setBounds(x, y, width, height);
    }

    public void setPreferredSize(Dimension size) {
        this.panel.setPreferredSize(size);
    }

}
